package com.bawei.mall.user.controller;

import com.bawei.common.core.domain.R;
import com.bawei.common.core.web.controller.BaseController;
import com.bawei.common.core.web.page.TableDataInfo;
import com.bawei.mall.user.domain.CusUserFootprintInfo;
import com.bawei.mall.user.service.ICusUserFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName CusUserFootprintController
 * @Description 描述
 * @Author ZiZheng.Li
 * @Date 2024/7/2 16:50
 */
@RestController
public class CusUserFootprintController extends BaseController {
    @Autowired
    private ICusUserFootprintService cusUserFootprintService;


    /**
     * 我的足迹
     */
    @GetMapping("/selectFootprintInfos")
    public TableDataInfo selectFootprintInfos()
    {
        startPage();
        List<CusUserFootprintInfo> list = cusUserFootprintService.selectCusUserFootprintInfoList();
        return getDataTable(list);
    }

    /**
     * 添加足迹
     */
    @PostMapping("/addFootprintInfo")
    public R addFootprintInfo(@RequestBody CusUserFootprintInfo cusUserFootprintInfo)
    {
        cusUserFootprintService.addUserFootprintInfo(cusUserFootprintInfo);
        return R.ok();
    }

    /**
     * 清空足迹
     */
    @PostMapping("/clearFootprintInfos")
    public R clearFootprintInfos()
    {
        cusUserFootprintService.clearFootprintInfos();
        return R.ok();
    }
}
